package com.lxyk.config;


import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;

@Component
@Aspect//这是一个切面类,关联切入点和通知
public class MyAdvice {

    //
    @Pointcut("execution(* com.lxyk.dao.impl.AnnimalsDaoImpl.dogShow(..))")
    public void pt()
    {

    }

    @Before("pt()")
    public  void before()
    {
        System.out.println("before");
    }

    @After("pt()")
    public void after()
    {
        System.out.println("after");
    }

}
